package org.example.mybatis.spring;

import org.example.mybatis.spring.config.MainConfig;
import org.example.mybatis.spring.mapper.UserMapper;
import org.example.mybatis.spring.model.User.UserInfo;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

public class MainApplication {
	public static void main(String[] args) {
		AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
		ctx.register(MainConfig.class);
		ctx.refresh();

		UserMapper userMapper = ctx.getBean(UserMapper.class);
		List<UserInfo> userList = userMapper.getUserList();

		userList.forEach(System.out::println);


		System.out.println("Hello world!");
	}
}